package com.aaa.controller;

import com.aaa.entity.DO.RentCaptureOperation;
import com.aaa.entity.result.Result;
import com.aaa.service.RentCaptureOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotBlank;

/**
 * @author ：陈凯歌
 * @date ：Created in 2021/1/27 20:43
 * @description：租金操作业务控制器
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/opear")
public class RentCaptureOperationController {

    /**
     * 注入RentCaptureOperationService
     */
    @Autowired
    private RentCaptureOperationService service;


    /**
     * 根据id删除数据
     */
    @PostMapping("/del")
    public Result deleteId(@NotBlank(message = "请传入id") @Validated Integer id){

        return service.delOperation(id);
    }

    /**
     * 修改租金详细信息
     */
    @PostMapping("/update")
    public Result updateOpera(@RequestBody RentCaptureOperation rentCaptureOperation){


        return service.upOpera(rentCaptureOperation);
    }



}
